package com.eway.viewanimator;

import android.animation.Animator;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

public class View_Property_animator_Activity extends AppCompatActivity implements View.OnClickListener {

	private TextView viewPropertyAnimatorTv;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_view__property_animator_);


		findViewById(R.id.view_property_animator_start).setOnClickListener(this);
		viewPropertyAnimatorTv = findViewById(R.id.view_property_animator_tv);


	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
			case R.id.view_property_animator_start:
				viewPropertyAnimatorTv
						.animate()
						.alpha(0.8f)
						.scaleX(3.0f)
						.scaleY(3.0f)
						.rotationX(360)
						.setDuration(4000)
						.setListener(new Animator.AnimatorListener() {
							@Override
							public void onAnimationStart(Animator animation) {
								Log.d("zwk", "onStart");
							}

							@Override
							public void onAnimationEnd(Animator animation) {
								Log.d("zwk", "onEnd");
							}

							@Override
							public void onAnimationCancel(Animator animation) {
								Log.d("zwk", "onCancel");
							}

							@Override
							public void onAnimationRepeat(Animator animation) {
								Log.d("zwk", "onRepeat");

							}
						})
				;
				break;
			default:
				break;
		}
	}
}
